/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2010
 */

package com.osgix.authorize.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.osgix.common.pojo.BaseEntity;

public class RolePrivilege extends BaseEntity implements java.io.Serializable {
	private static final long serialVersionUID = 5454155825314635342L;

	// alias
	public static final String TABLE_ALIAS = "RolePrivilege";
	public static final String ALIAS_ROLE_PRIVILEGE_ID = "rolePrivilegeId";
	public static final String ALIAS_ROLE_ID = "roleId";
	public static final String ALIAS_PRIVILEGE_ID = "privilegeId";

	// date formats

	// 可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	// columns START

	private Long rolePrivilegeId;

	private Long roleId;

	private Long privilegeId;

	// columns END

	public RolePrivilege() {
	}

	public RolePrivilege(Long rolePrivilegeId) {
		this.rolePrivilegeId = rolePrivilegeId;
	}

	public void setRolePrivilegeId(Long value) {
		this.rolePrivilegeId = value;
	}

	public Long getRolePrivilegeId() {
		return this.rolePrivilegeId;
	}

	public void setRoleId(Long value) {
		this.roleId = value;
	}

	public Long getRoleId() {
		return this.roleId;
	}

	public void setPrivilegeId(Long value) {
		this.privilegeId = value;
	}

	public Long getPrivilegeId() {
		return this.privilegeId;
	}

	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
				.append("RolePrivilegeId", getRolePrivilegeId()).append("RoleId", getRoleId())
				.append("PrivilegeId", getPrivilegeId()).toString();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(getRolePrivilegeId()).toHashCode();
	}

	public boolean equals(Object obj) {
		if (obj instanceof RolePrivilege == false)
			return false;
		if (this == obj)
			return true;
		RolePrivilege other = (RolePrivilege) obj;
		return new EqualsBuilder().append(getRolePrivilegeId(), other.getRolePrivilegeId()).isEquals();
	}
}
